﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using JiveMessenger.ImagePreview.GfyCat;
using System.ComponentModel;
using JiveMessenger.ImagePreview.Imgur;

namespace JiveMessenger.Views
{
    /// <summary>
    /// Interaction logic for ImagePreviewPage.xaml
    /// </summary>
    public partial class ImagePreviewPage : Page, INotifyPropertyChanged
    {
        private GfyCatVideoFormat _gfyCatVideoFormat;
        public GfyCatVideoFormat GfyCatVideoFormat
        {
            get { return _gfyCatVideoFormat; }
            set
            {
                if (_gfyCatVideoFormat != value)
                {
                    _gfyCatVideoFormat = value;
                    RaisePropertyChanged("GfyCatVideoFormat");
                }
            }
        }

        private ImgurVideoFormat _imgurVideoFormat;
        public ImgurVideoFormat ImgurVideoFormat
        {
            get { return _imgurVideoFormat; }
            set
            {
                if (_imgurVideoFormat != value)
                {
                    _imgurVideoFormat = value;
                    RaisePropertyChanged("ImgurVideoFormat");
                }
            }
        }
        
        public ImagePreviewPage()
        {
            InitializeComponent();
           
            GfyCatVideoFormat = (GfyCatVideoFormat)Enum.Parse(typeof(GfyCatVideoFormat), Properties.Settings.Default.SettingGfyCatVideoFormat);
            ImgurVideoFormat = (ImgurVideoFormat)Enum.Parse(typeof(ImgurVideoFormat), Properties.Settings.Default.SettingImgurVideoFormat);
 
        }
        protected virtual void RaisePropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
        public event PropertyChangedEventHandler PropertyChanged;
    }
}
